/*
 * 公共基础接口
 */
import request from '../untils/request'
import type { ILoginResponse } from './types/common'

export const getLoginInfo = () => {
  return request({
    method: 'GET',
    url: '/login/info'

  })
}

// 获取图片验证码
export const getCaptcha = () => {
  return request({
    method: 'GET',
    url: '/captcha_pro',
    params: {
      stamp: Date.now()
    },
    responseType: 'blob'

  })
}
// 登录
export const login = (data: {
  account: string
  pwd: string
  imgcode: string
}) => {
  return request<ILoginResponse>({
    method: 'POST',
    url: '/login',
    data
  })
}

export const logout = () => {
  return request({
    method: 'GET',
    url: '/setting/admin/logout'
  })
}
